<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>form表单</title>
		<link rel="stylesheet" href="/adminSite/css/X-ui.css" />
		<link rel="stylesheet" href="/adminSite/css/article-xq.css" />
		<!--[if lt IE 9]>
			<script type="text/javascript" src="/adminSite/js/html5.js"></script>
		<![endif]-->
		<style>
			.form-select{margin-left:-1px;}
			.x-ui-form .textarea{margin-top:-1px;}
		</style>
	</head>
	<body>
		<ol class="breadcrumb-nav">
			<li>
				<a href="/admin">主页</a>
			</li>
			<li>
				<a href="/admin/article">栏目列表</a>
			</li>
			<li>
				添加栏目
			</li>
		</ol>
		<form class="x-ui-form form pd-40 mt-10">
			<!--标题-->
			<div class="row cl">
				<label class="form-label col-2">
					栏目名称
				</label>
				<div class="col-10">
					<input type="text" name="name" placeholder="请输入栏目名称" required class="input-text"/>
				</div>
			</div>
			<!--栏目简介-->
			<div class="row cl">
				<label class="form-label col-12 text-l">栏目简介</label>
				<div class="col-12" id="conetne">
					<textarea class="textarea" name="briefing" required placeholder="请输入栏目简介"></textarea>
				</div>
			</div>
			<!--是否隐藏-->
			<div class="row cl">
				<label class="form-label col-2">是否隐藏</label>
				<div class="col-10">
					<div class="form-select" style="width:200px">
						<select required name="isShow">
							<option value="1">是</option>
							<option value="0" selected>否</option>
						</select>
					</div>
				</div>
			</div>
			<div class="row">
				<!--按钮-->
				<div class="btn btn-submit" id="submit">提交</div>
			</div>
		</form>
		<script type="text/javascript" src="/adminSite/js/jquery-1.11.0.js" ></script>
		<!--弹窗-->
		<script type="text/javascript" src="/adminSite/js/extend/X-ui-modal/js/X-ui-modal.js" ></script>
		<script type="text/javascript" src="/adminSite/js/H-ui-form.js" ></script>
		<script>
			var form = new XuiForm();
			form.checkbox();
			//select
			form.select();
			form.verification(".form" , "#submit" , {

			},{
				name : {
					empty : "请输入栏目名称"
				},
				required : {
					empty : "请输入栏目简介"
				}
			}, function(data){
				$.post("/admin/addColumn" , data , function(data){
					if(data.state == "ok"){
						XuiModal().msg("发布成功!" , {icon : 4} , function(){
							//window.location.href = "/admin/article";
						})
					}else{
						XuiModal().msg(data.message , {icon : 2});
					};
				},"JSON")
			});
		</script>
	</body>
</html>
